package com.cmc.cloud.cmclink.doc.api.document;

import com.cmc.cloud.cmclink.doc.api.document.req.so.SoCancelReqDto;
import com.cmc.cloud.cmclink.doc.api.document.req.so.sovo.sovo.SoCreateAndUpdateReqDTO;
import com.cmc.cloud.cmclink.doc.api.document.req.so.sovo.sovo.SoDetailCompareRespDTO;
import com.cmc.cloud.cmclink.doc.api.document.req.soamendapplyvo.SoAmendApplyRespVO;
import com.cmc.cloud.cmclink.doc.constant.DocApiConstants;
import com.cmes.framework.common.pojo.CommonResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;

/**
 * @Author：Jie Ni
 * @Date: 2025/10/1 13:26
 * @Description: 订舱修改申请服务类
 */
@FeignClient(name = DocApiConstants.NAME)
@Tag(name = "RPC - 服务 订舱修改申请")
public interface SoAmendApplyInfoApi {

    String PREFIX = DocApiConstants.PREFIX + "/amendApply";

    /**
     * SO订舱修改申请查询(订舱更改处理中or客户取消订舱处理中)
     *
     * @param soId
     * @return
     */
    @GetMapping(PREFIX + "/getSoAmendApply/{soId}")
    @Operation(summary = "订舱修改申请查询(通过soId)")
    CommonResult<SoAmendApplyRespVO> getSoAmendApply(@PathVariable("soId") Long soId);

    /**
     * 直接撤销订舱修改申请
     *
     * @param amendApplyId
     * @return
     */
    @Operation(summary = "撤销订舱修改申请")
    @GetMapping(PREFIX + "/revertSoAmendApply/{amendApplyId}")
    CommonResult<Void> revertSoAmendApply(@PathVariable("amendApplyId") Long amendApplyId);

    /**
     * 网厅订舱修改船期数据
     *
     * @param input
     * @return
     */
    @Operation(summary = "订舱已确认改船名航次申请")
    @PostMapping(PREFIX + "/changeVesselInfoForWeb")
    CommonResult<Long> changeVesselInfoForWeb(@RequestBody @Valid SoCreateAndUpdateReqDTO input);

    /**
     * 订舱已确认修改内容申请
     *
     * @param input
     * @return
     */
    @Operation(summary = "订舱已确认修改内容申请")
    @PostMapping(PREFIX + "/changeSoInfoForWeb")
    CommonResult<Long> changeSoInfoForWeb(@RequestBody @Valid SoCreateAndUpdateReqDTO input);

    /**
     * 订舱对比查看
     *
     * @param amendApplyId 审批表主键ID
     * @return 比对结果
     */
    @Operation(summary = "订舱对比查看")
    @GetMapping(PREFIX + "/compare/{amendApplyId}")
    CommonResult<SoDetailCompareRespDTO> compare(@PathVariable("amendApplyId") Long amendApplyId);

}
